<link rel="stylesheet" type="text/css" href="../css/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../css/themes/icon.css">

<div id="panel-drug-counting-pop-doct" data-options="border:false;width:100%">
	<div class="easyui-panel list-panel" data-options="openAnimation:'slide',closeAnimation:'slide'">
	  	<div>
			<a href="javascript:void(0);" class="easyui-linkbutton function-btn l-btn l-btn-small l-btn-plain" iconcls="icon-undo" plain="true">金额排名</a>
			<a href="javascript:void(0);" class="easyui-linkbutton function-btn l-btn l-btn-small l-btn-plain" iconcls="icon-undo" plain="true">数量排名</a>
			<a href="javascript:void(0);" class="easyui-linkbutton function-btn l-btn l-btn-small l-btn-plain" iconcls="icon-undo" plain="true">药占比</a>
		</div>
	 	<div class="well well-small" style="margin-left: 5px;margin-top: 5px">
			<p>
				<span class="badge">提示</span>
				 <strong><font color="red">单击</font></strong> 按钮, 可以改变排序方式默认为数量排序
			</p>			
		</div>	
	
		<table class="easyui-datagrid dg-list" 
			data-options="rownumbers:true,
			animate: true,						
			striped:true,
			border:true,
			//singleSelect:false,
			idField: 'id',						
			fitColumns: true,
			checkOnSelect:true,
			selectOnCheck:true,
			pagination : true">
			
			<thead>						
				<tr>								
					<th field="doct_name" width="80" align="center">医生名字</th>					
					<th field="drug_sum" width="60" align="center">药品数量</th>
					<th field="drug_price" width="100" align="center">药品金额</th>
					<th field="medical_per" width="60" align="center" data-options="
						styler: function(value,row,index){
							var standard
							standard = 60
							if (value){
								if(value > standard){
									return 'color:red;';							
								}else{
									return 'color:green;';
								}
							}else{
								return 'color:green;';
							}
						},formatter: function(value,row,index){
							var medical_percent, total, medical
							if(row && row.total_price && row.total_price > 0){
								if(row.drug_price){
									medical_percent = row.drug_price / row.total_price
									medical_percent = medical_percent * 100
								}
								else{
									medical_percent = 0
								}
								if (medical_percent && medical_percent > 0){
									return medical_percent.toFixed(2) +'%';							
								}else{
									return '0.0%';
								}
							}
							else{
								return '0.0%';
							}
						}
						
					">药占比</th>
										
				</tr>
			</thead>
			
		</table>
	</div>
	
</div> 
<div id="win-outpatient-item-fee" data-options="border:false;width:100%"></div>
 
<script>
requirejs(['popListPage','drugCounting','domReady!'],function(flowedit,drugCounting,doc){
	flowedit.init({doc:doc,
		rootId:'panel-drug-counting-pop-doct',
		subSystemCode:'medical',
		moduleCode:'drugCountingInfo',
		queryModule:'drugCounting',
		queryMethod:'popPage',
		querylistUrl:'getListDomain',
		editWindow:'drug-counting-pop-win',
		initElement:drugCounting.initMain
	});
});	
</script>

